package gr.atc.epart.net;

import gr.atc.epart.actions.Action;
import gr.atc.epart.actions.ActionComment;
import gr.atc.epart.actions.Petition;
import gr.atc.epart.actions.PetitionSignature;
import gr.atc.epart.actions.Action.Type;

import java.util.Date;
import java.util.List;

import android.util.Pair;

public interface IClient {

	public void logIn(String username, String password) throws LogInException;
	
	public void logOut();
	
	public ActionsPage getActions(Action.Type actionType,
								  String searchText,
								  String creator,
							      Date startDate,
							      Date stopDate,
							      String [] tags,
							      ActionsPage.SortBy sortBy,int pageNumber,int pageSize);
	
	public ActionsPage getActions(int pageSession, int page);
	
	public boolean createAction(Type actionType, String name, String description, String creator,Date startDate, Date stopDate, String[] tags,boolean isLoginRequired,int seriesId);
	
	public int createPetition(Petition petition) throws CreateFailedException;
	
	public Petition getPetition(int petitionId) throws RetrievalFailedException; 
	
	public Pair<Petition,Boolean> getPetitionStatus(int petitionId,String userName) throws RetrievalFailedException;
	
	public List<PetitionSignature> getSignaturesForPetition(int petitionId) throws RetrievalFailedException;
	
	public void voteForPetition(int petitionId, String userName,String comment) throws CreateFailedException;

	public boolean commentOnAction(int actionId, String userName,String comment) throws CreateFailedException;
	
	public List<ActionComment> getComments(int actionId, int pageNumber,int pageSize) throws RetrievalFailedException;

	

}
